home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntlib25
/
alloca.s
< prev
next >
Wrap
Text File
|
1992-09-29
|
509b
|
25 lines
#APP
#
# alloca(nbytes) allocate junk in stack frame
#
# void *alloca(size_t size)
#
.text
.even
.globl _alloca
_alloca:
movel sp@+,a0 | get return addr
movel sp@+,d0 | get size -- assist in bug fix, add 4 to sp
addql #1,d0 | ensure address even
bclr #0,d0 | lop off odd bit
subl d0,sp | increase stack frame size by that much
movel sp,d0 | set up to return it
lea sp@(-4),sp | new top of stack (real bug fix here)
jmp a0@ | return by jmping via saved addr